/*
 * Project: D-Link TR-069
 * 
 * File:   sql.h
 * 
 * Authors: Taron Sargsyan <taronhsargsyan@gmail.com>	
 * 	    Suren Gharagyozyan	
 *
 * Created on September 20, 2011, 11:53 AM
 * 
 * 
 * This object is useful to implementing MySQL e.g.
 * implementing C/MySQL API .
 * 
 * Copyright (C) 2011 D-Link Company.  All rights reserved.
 */


#ifndef _SQL_H_
#define _SQL_H_

#include <mysql.h>

#define SUCCESS 1
#define FAILURE 0

#define QUERY_SIZE 512


extern MYSQL *conn;
extern MYSQL_RES *res;
extern MYSQL_ROW row;

extern char *server;      
extern char *user;       
extern char *password;	   
extern char *database;	   


extern int sqlCon();	

extern char* sel_model_name_from_db;
extern char* sel_dev_id;
extern char* set_value_query;
extern char* set_value_answer_query;
extern char* set_param_value_query;
extern char* get_param_value_ids;
extern char* insert_param_value_device;
extern char* chack_param_exists;
extern char* update_param_value_device;
extern char* set_param_value_history;
extern char* get_device_param_value_ids;
extern char* sel_history_id;

extern char* sel_or_upd;
extern char new_query[QUERY_SIZE];
extern char new_query1[QUERY_SIZE];

extern char sel_reboot_query[QUERY_SIZE];	
extern char update_reboot_query[QUERY_SIZE];

extern char fw_finish_xml[1024];

char get_value_xml[4096];
char returnModelId[5];
char return_set_value_xml[2048];
char select_param_name_query[128];
char return_fw_xml[1024];
char fw_ifexist_query[1024];
char done_upgrade_query[QUERY_SIZE];


#endif